using System;
using System.Collections.Generic;
using FluorineFx;
using FluorineFx.AMF3;

/// <summary>
/// Summary description for ASObjectCache
/// </summary>
public class ASObjectCache
{
    private Dictionary<int, Dictionary<int, ASObject>> inner = new Dictionary<int, Dictionary<int, ASObject>>();

    public ASObject this[int cid, int lid]
    {
        get 
        {
            if (!inner.ContainsKey(cid))
                inner.Add(cid, new Dictionary<int, ASObject>());
            if (!inner[cid].ContainsKey(lid))
                inner[cid].Add(lid, new ASObject());
            return inner[cid][lid];
        }
        set 
        {
            if (!inner.ContainsKey(cid))
                inner.Add(cid, new Dictionary<int, ASObject>());
            if (!inner[cid].ContainsKey(lid))
                inner[cid].Add(lid, value);
            else
                inner[cid][lid] = value;
        }
    }
}
